import React, { useState ,useEffect} from 'react'

export default function Count(){
  const [count,setCount] = useState(0)
  const countIncrement = () => setCount(count+1)
  useEffect(() => {
    console.log('useEffect')
    return () => {
      console.log('return')
    }
  },[count])
  console.log(count)
  return (
    <div>
      <h1>Hook组件</h1>
      <p>you click me {count} times</p>
      <input type="button" onClick={countIncrement} value='+'/>
    </div>
  )
}
